#include <stdio.h>
#include <signal.h>
void sig_catch(int signo)
{
    if(signo == SIGINT)
    {
        printf("catch you SIGINT: %d\n",signo);
    }
    else if(signo == SIGQUIT)
    {
        printf("catch you SIGQUIT: %d\n",signo);
    }
    return ;
}

int main()
{
    struct sigaction act,oldact;
    act.sa_handler = sig_catch;
    sigemptyset(&(act.sa_mask));
    act.sa_flags = 0;
    int ret = sigaction(SIGINT,&act,&oldact);
    ret = sigaction(SIGQUIT,&act,&oldact);
    signal(SIGINT,sig_catch);
    while(1);
    return 0;
}
